const net = require('net')


const clients = []

function broadcast(client, msg){

}


const serve = net.createServer((socket)=>{
  const id = Math.random().toString().slice(2)

  console.log(id)

  socket.write('Hello,world!')

  socket.on('data', (data)=>{
    console.log(data.toString())
  })

})

serve.on('error', ()=>{

})

serve.on('close', ()=>{

})

serve.listen(8000, ()=>{
  console.log('Server is running ... ', serve.address())
})